<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function f() {
           var a = document.getElementById("tex").value;
           var b = a.split("").reverse().join("");
           if (a == b) {
               document.getElementById("result").innerHTML = a+"是对称字符串";
           }else {
               document.getElementById("result").innerHTML = a+"不是对称字符串";
           }
        }
    </script>
</head>
<body>
    <input type="text" id="tex"><button type="button" style="margin-left: 10px" onclick="f()">开始判断</button>
    <div id="result"></div>
</body>
</html>